package pair.parking.bean;

import java.util.Set;

/**
 * Create by Vic Xu on 8/23/2018
 *
 * @author Vic Xu
 */
public class ParkingLot implements Comparable<ParkingLot> {

    private int id;

    private Set<Car> carSet;

    private int maxSpace;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Set<Car> getCarSet() {
        return carSet;
    }

    public void setCarSet(Set<Car> carSet) {
        this.carSet = carSet;
    }

    public int getMaxSpace() {
        return maxSpace;
    }

    public void setMaxSpace(int maxSpace) {
        this.maxSpace = maxSpace;
    }

    public boolean isFull() {
        return carSet.size() < maxSpace;
    }

    @Override
    public int compareTo(ParkingLot o) {
        return this.carSet.size() - o.carSet.size();
    }
}
